package com.jadeen.service.impl;


import com.jadeen.common.utils.DateUtils;
import com.jadeen.entity.domain.ResourceLink;
import com.jadeen.mapper.ResourceLinkMapper;
import com.jadeen.service.IResourceLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 资源链接Service业务层处理
 * 
 * @author jadeen
 * @date 2025-08-08
 */
@Service
public class ResourceLinkServiceImpl implements IResourceLinkService
{
    @Autowired
    private ResourceLinkMapper resourceLinkMapper;

    /**
     * 查询资源链接
     * 
     * @param linkId 资源链接主键
     * @return 资源链接
     */
    @Override
    public ResourceLink selectResourceLinkByLinkId(Long linkId)
    {
        return resourceLinkMapper.selectResourceLinkByLinkId(linkId);
    }

    /**
     * 查询资源链接列表
     * 
     * @param resourceLink 资源链接
     * @return 资源链接
     */
    @Override
    public List<ResourceLink> selectResourceLinkList(ResourceLink resourceLink)
    {
        return resourceLinkMapper.selectResourceLinkList(resourceLink);
    }

    /**
     * 新增资源链接
     * 
     * @param resourceLink 资源链接
     * @return 结果
     */
    @Override
    public int insertResourceLink(ResourceLink resourceLink)
    {
        resourceLink.setCreateTime(DateUtils.getNowDate());
        return resourceLinkMapper.insertResourceLink(resourceLink);
    }

    /**
     * 修改资源链接
     * 
     * @param resourceLink 资源链接
     * @return 结果
     */
    @Override
    public int updateResourceLink(ResourceLink resourceLink)
    {
        resourceLink.setUpdateTime(DateUtils.getNowDate());
        return resourceLinkMapper.updateResourceLink(resourceLink);
    }

    /**
     * 批量删除资源链接
     * 
     * @param linkIds 需要删除的资源链接主键
     * @return 结果
     */
    @Override
    public int deleteResourceLinkByLinkIds(Long[] linkIds)
    {
        return resourceLinkMapper.deleteResourceLinkByLinkIds(linkIds);
    }

    /**
     * 删除资源链接信息
     * 
     * @param linkId 资源链接主键
     * @return 结果
     */
    @Override
    public int deleteResourceLinkByLinkId(Long linkId)
    {
        return resourceLinkMapper.deleteResourceLinkByLinkId(linkId);
    }
}
